import dynamic from 'dva/dynamic';

// wrapper of dynamic
const dynamicWrapper = (app, models, component) => dynamic({
  app,
  models: () => models.map(m => import(`../models/${m}.js`)),
  component,
});


export const EnterpriseManagement = (app) => {
  return {
    name: '企业管理',
    icon: 'qiyeguanli',
    path: 'enterprise',
    children: [
      {
        name: '企业信息',
        path: 'company',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Company/Company')),
      },
      {
        name: '',
        path: 'company/insurance/:comInsId',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Company/InsuranceDetails')),
      },
      {
        name: '企业报备',
        path: 'reported',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/Reported')),
      },
      {
        name: '',
        path: 'reported/districtbasic',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/DistrictBasic')),
      },
      {
        name: '',
        path: 'reported/districtdetails/:crossManageId',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/DistrictDetails')),
      },
      {
        name: '',
        path: 'reported/overseasbasic',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/OverseasBasic')),
      },
      {
        name: '',
        path: 'reported/overseasdetails/:overseaManageId',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/OverseasDetails')),
      },
      {
        name: '',
        path: 'reported/shareholder',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/Shareholder')),
      },
      {
        name: '',
        path: 'reported/initializationstock',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/InitializationStock')),
      },
      {
        name: '',
        path: 'reported/changeownership',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/ChangeOwnership')),
      },
      {
        name: '',
        path: 'reported/shareholderchangelog',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/ShareholderChangeLog')),
      },
      {
        name: '',
        path: 'reported/managementbasic',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/ManagementBasic')),
      },
      {
        name: '',
        path: 'reported/managementadd/:comManagerId',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/ManagementAdd')),
      },
      {
        name: '',
        path: 'reported/managementchange',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/ManagementChange')),
      },
      {
        name: '',
        path: 'reported/managementchangereport',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/ManagementChangeReport')),
      },
      {
        name: '',//在职人员 离职人员
        path: 'jobtab',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Reported/JobTab')),
      },
      {
        name: '分公司管理',
        path: 'branchcompanymanager',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/BranchCompany/BranchCompanyManager')),
      },
      {
        name: '',//分公司管理层，分公司管理层变更记录
        path: 'branchcompanytab',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/BranchCompany/BranchCompanyTab')),
      },
      {
        name: '',//子公司
        path: 'childcompanymanager',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/BranchCompany/ChildCompanyManager')),
      },
      {
        name: '企业设置',
        path: 'site',
        component: dynamicWrapper(app, ['profile'], () => import('../routes/Enterprise/Site/Set')),
      },

    ],
  };
};
